package com.wardrobe.dao.goods_order;


import com.wardrobe.domain.common.BackEndFromBean;
import com.wardrobe.domain.goods_order.GoodsOrderBean;
import com.wardrobe.domain.goods_order.GoodsOrderShowBean;
import com.wardrobe.mapper.master.goods_order.GoodsOrderMasterMapper;
import com.wardrobe.mapper.slave.goods_order.GoodsOrderSlaveMapper;
import com.wardrobe.soa.backend.goods_order.BackGoodsOrderFromBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * Created by Administrator on 2018/11/20.
 */
@Service
public class GoodsOrderDao {
    @Autowired
    private GoodsOrderMasterMapper goodsOrderMasterMapper;
    @Autowired
    private GoodsOrderSlaveMapper goodsOrderSlaveMapper;

    public GoodsOrderShowBean selectGoodsOrderById(long id){
        return goodsOrderSlaveMapper.selectGoodsOrderById(id);
    }

    public GoodsOrderShowBean selectGoodsOrderByOrderId(long orderId){
        return goodsOrderSlaveMapper.selectGoodsOrderByOrderId(orderId);
    }

    public List<GoodsOrderShowBean> selectGoodsOrder(long userId, int status){
        return goodsOrderSlaveMapper.selectGoodsOrder(userId,status);
    }

    public int insertGoodsOrder(GoodsOrderBean goodsOrderbean){
        return goodsOrderMasterMapper.insertGoodsOrder(goodsOrderbean);
    }

    public int updateGoodsOrder(BackEndFromBean fromBean){
        return goodsOrderMasterMapper.updateGoodsOrder(fromBean);
    }

    public int updateGoodsOrderPayTime(long orderId){
        return goodsOrderMasterMapper.updateGoodsOrderPayTime(orderId);
    }

    public List<GoodsOrderShowBean> selectGoodsOrderList(BackGoodsOrderFromBean fromBean){
        return goodsOrderSlaveMapper.selectGoodsOrderList(fromBean);
    }

    public long countGoodsOrder(BackGoodsOrderFromBean fromBean){
        return goodsOrderSlaveMapper.countGoodsOrder(fromBean);
    }

    public int updateGoodsOrderByOrderId(long orderId,int status){
        return goodsOrderMasterMapper.updateGoodsOrderByOrderId(orderId,status);
    }
}
